import request from '@/utils/request'

// 活动列表
export function getKillActivityListApi(query){
  return request({
    url:'/saleActivity/list',
    method:'get',
    params:query
  })
}

// 创建或编辑活动
export function addOrEditKillActivityApi(obj){
  return request({
    url:'/saleActivity/save',
    method:'post',
    data:obj
  })
}

// 根据id获取秒杀活动详情
export function getKillActivityDetailApi(id){
  return request({
    url:`/saleActivity/getById`,
    method:'get',
    params:{id}
  })
}


// 活动启动停止切换
export function changeKillActivityStatusApi(id){
  return request({
    url:`/saleActivity/enable/${id}`,
    method:'get',
  })
}


// 删除活动
export function deleteKillActivityApi(ids){
  return request({
    url:`/saleActivity/delete`,
    method:'get',
    params:{ids}
  })
}

// 查询秒杀订单列表
export function getKillActivityOrderListApi(query){
  return request({
    url:`/saleActivityOrder/list`,
    method:'get',
    params:query
  })
}


// 秒杀订单退款
export function refundKillOrderApi(id){
  return request({
    url:`/saleActivityOrder/refund`,
    method:'get',
    params:{id}
  })
}


// 获取秒杀数据汇总
export function getKillSumDataApi(query){
  return request({
    url:'/saleActivityOrder/sum',
    method:'get',
    params:query
  })
}


// 导出
export function exportKillApi(query){
  return request({
    url:'/saleActivityOrder/export',
    method:'get',
    params:query
  })
}